/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bookingsystem;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 *
 * @author admin
 */
public class Main {

    /**
     * @param args the command line arguments
     */
   public static void main(String[] args) throws IOException {
        StartStopForm stForm = new StartStopForm();
        
        ServerSocket server = null;
        int port = 7777;

        Socket client = null;
        try{
            while(true){
            ServerThread st;
            try {
                stForm.setVisible(true);
                server = new ServerSocket(port);
                st = new ServerThread(server.accept());
                Thread t = new Thread(st);
                t.start();
            } catch (IOException e) {
                System.err.println("Accept failed.");
                System.exit(1);
            }
            server.close();
            }
        }
        catch (IOException e){
            System.out.println(e);
        }
    }
}
